-- Basic Cannon

local BULLET = {}

-- General Information
BULLET.Name = "Mexican Sniper"
BULLET.Author = "Krasher"
BULLET.Description = "Make sure not to aim at pingaz."
BULLET.AdminOnly = false
BULLET.SuperAdminOnly = false

-- Appearance
BULLET.Model = "models/props_junk/rock001a.mdl"
BULLET.Material = nil
BULLET.Color = nil 
BULLET.Trail = { StartSize = 30, EndSize = 0, Length = 4, Texture = "trails/laser.vmt", Color = Color( 255, 0, 0) } -- if you want to set a trail on your turret, put a table with the necessary contents. Example: { StartSize = 40, EndSize = 0, Length = 4, Texture = "trails/laser.vmt", Color = Color( 255, 0, 0) }

-- Effects / Sounds
BULLET.FireSound = {"rnd/Silencer.wav"} -- use as many sounds as you want
BULLET.ExplosionSound = nil
BULLET.FireEffect = "cannon_flare"
BULLET.ExplosionEffect = "medlaser"
BULLET.EmptyMagSound = {}

-- Movement
BULLET.Speed = 55
BULLET.Gravity = 0.2
BULLET.RecoilForce = 100
BULLET.Spread = 3.2

-- Damage
BULLET.DamageType = "BlastDamage" 
BULLET.Damage = 100
BULLET.Radius = nil
BULLET.RangeDamageMul = 0.3 
BULLET.NumberOfSlices = nil 
BULLET.SliceDistance = nil 
BULLET.Duration = nil
BULLET.PlayerDamage = 150
BULLET.PlayerDamageRadius = 300

-- Reloading/Ammo
BULLET.Reloadtime = 2.0
BULLET.Ammo = 0 -- If you set this to 0, it will have infinite ammo
BULLET.AmmoReloadtime = 0

-- Other
BULLET.Lifetime = {0,0}
BULLET.ExplodeAfterDeath = false 
BULLET.EnergyPerShot = 4000 

BULLET.CustomInputs = nil 
BULLET.CustomOutputs = nil 

-- Custom Functions (Only for adv users)
-- (If you set the override var to true, the cannon/bullet will run these instead. Use these functions to do stuff which is not possible with the above variables)
-- I suggest you erase any functions you are not using to minimize file size.

-- Wire Input (This is called whenever a wire input is changed) (Is run on: Cannon)
BULLET.WireInputOverride = false
function BULLET:WireInput( self, inputname, value )
	-- Nothing
end

-- Fire (Is called before the cannon is about to fire) (Is run on: Cannon)
BULLET.FireOverride = false
function BULLET:Fire( self )
	-- Nothing
end

-- Initialize (Is called when the bullet initializes) (Is run on: Bullet)
BULLET.InitializeOverride = false
function BULLET:InitializeFunc( self )   
	-- Nothing
end

-- Cannon Think (Is run on: Cannon)
BULLET.CannonThinkOverride = false
function BULLET:CannonThink( self )
	-- Nothing
end

-- Think (Is run on: Bullet)
BULLET.ThinkOverride = false
function BULLET:ThinkFunc( self )
	-- Nothing
end

-- Explode (Is called when the bullet explodes) Note: this will not run if you override the think function (unless you call it from there as well) (Is run on: Bullet)
BULLET.ExplodeOverride = false
function BULLET:Explode( self, trace )
	-- Nothing
end

-- This is called when the cannon collides (Is run on: Cannon)
BULLET.CannonPhysicsCollideOverride = false
function BULLET:CannonPhysicsCollideFunc(Data, PhysObj)
	-- Nothing
end

-- This is called when the cannon touches another entity (Is run on: Cannon)
BULLET.CannonTouchOverride = false
function BULLET:CannonTouchFunc(Ent)	

end

-- This is called when the bullet collides (Advanced users only. It only works if you first override initialize and change it to vphysics) (Is run on: Bullet)
BULLET.PhysicsCollideOverride = false
function BULLET:PhysicsCollideFunc(CollisionData, PhysObj)
	-- Nothing
end

-- Client side overrides:

-- Initialize (Is run on: Bullet)
BULLET.CLInitializeOverride = false
function BULLET:CLInitializeFunc()
	-- Nothing
end

-- Cannon Initialize (Is run on: Cannon)
BULLET.CLCannonInitializeOverride = false
function BULLET:CLCannonInitializeFunc()
	-- Nothing
end

-- Think (Is run on: Bullet)
BULLET.CLThinkOverride = false
function BULLET:CLThinkFunc()
	-- Nothing
end

-- Cannon Think (Is run on: Cannon)
BULLET.CLCannonThinkOverride = false
function BULLET:CLCannonThinkFunc()
	-- Nothing
end


-- Draw (Is run on: Bullet)
BULLET.CLDrawOverride = false
function BULLET:CLDrawFunc()
	-- Nothing
end

-- Cannon Draw (Is run on: Cannon)
BULLET.CLCannonDrawOverride = false
function BULLET:CLCannonDrawFunc()
	-- Nothing
end

pewpew:AddBullet( BULLET )